﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace IndoorPosition.Server.Database.Migrations.Migrations
{
    public partial class v003 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "Route",
                table: "Floor",
                type: "varchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "路径",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "路径")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Floor",
                type: "varchar(10)",
                maxLength: 10,
                nullable: true,
                comment: "楼层名称",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "楼层名称")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Model",
                table: "Floor",
                type: "varchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "模型",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "模型")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Building",
                type: "varchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "建筑物名称",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "建筑物名称")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "Route",
                table: "Floor",
                type: "longtext",
                nullable: true,
                comment: "路径",
                oldClrType: typeof(string),
                oldType: "varchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "路径")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Floor",
                type: "longtext",
                nullable: true,
                comment: "楼层名称",
                oldClrType: typeof(string),
                oldType: "varchar(10)",
                oldMaxLength: 10,
                oldNullable: true,
                oldComment: "楼层名称")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Model",
                table: "Floor",
                type: "longtext",
                nullable: true,
                comment: "模型",
                oldClrType: typeof(string),
                oldType: "varchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "模型")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Building",
                type: "longtext",
                nullable: true,
                comment: "建筑物名称",
                oldClrType: typeof(string),
                oldType: "varchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "建筑物名称")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }
    }
}
